package com.xy.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Cacheable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;

/*
 * @教师领书表
 */
@SuppressWarnings("serial")
@Entity
@Table
@Cacheable
public class DeliverToTeacher extends Identified implements Serializable {
  @Column(nullable = false)
  private Date deliverTime;// 发放日期
  @Column(nullable = false)
  private int amount;// 数量
  @Column(nullable = false)
  private String name;// 领书人姓名
  // 对应到操作员表
  @ManyToOne(targetEntity = Admin.class)
  @JoinColumn(name = "Admin_Id", referencedColumnName = "id" )
  @Cascade(CascadeType.SAVE_UPDATE)
  private Admin admin;
  // 对应到教材表
  @ManyToOne(targetEntity = TextBook.class)
  @JoinColumn(name = "TextBook_id", referencedColumnName = "id" )
  @Cascade(CascadeType.SAVE_UPDATE)
  private TextBook textBook;

  public Date getDeliverTime() {
    return deliverTime;
  }

  public void setDeliverTime(Date deliverTime) {
    this.deliverTime = deliverTime;
  }

  public int getAmount() {
    return amount;
  }

  public void setAmount(int amount) {
    this.amount = amount;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public Admin getAdmin() {
    return admin;
  }

  public void setAdmin(Admin admin) {
    this.admin = admin;
  }

  public TextBook getTextBook() {
    return textBook;
  }

  public void setTextBook(TextBook textBook) {
    this.textBook = textBook;
  }

  public DeliverToTeacher() {
    super();
    // TODO Auto-generated constructor stub
  }

}
